﻿@model FlyingClub.Models.ViewsModels.FlightCreate

@{
    ViewBag.Title = "Ajouter nouveau vol solo";
}

<h1>@ViewBag.Title</h1>
<script src="../../Scripts/jquery-ui-1.8.11.min.js" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>

<h3>@ViewBag.ErrorMessage</h3>

@using (Html.BeginForm())
{
    @Html.ValidationSummary(true)

    <p>@Html.LabelFor(model => model.DepartureDay, "Date de départ")@Html.DropDownListFor(model => model.DepartureDay, new SelectList(FlyingClub.Models.ViewsModels.DropDownLists.Days))<label style="width : auto;">/</label>@Html.DropDownListFor(model => model.DepartureMonth, new SelectList(FlyingClub.Models.ViewsModels.DropDownLists.Months))<label style="width : auto;">/</label>@Html.DropDownListFor(model => model.DepartureYear, new SelectList(FlyingClub.Models.ViewsModels.DropDownLists.Years))<label style="width : auto; color : rgb(255, 0, 0);">*</label><label style="width : auto;">Heure de départ</label>@Html.DropDownListFor(model => model.DepartureHour, new SelectList(FlyingClub.Models.ViewsModels.DropDownLists.Hours))<label style="width : auto; color : rgb(255, 0, 0);">*</label></p>
    <p class="break-line"></p>
    <p>@Html.LabelFor(model => model.DepartureAirfield, "Aéroport de départ")@Html.TextBoxFor(model => model.DepartureAirfield)<label style="width : auto; color : rgb(255, 0, 0);">*</label>@Html.ValidationMessageFor(model => model.DepartureAirfield)</p>
    <p class="break-line"></p>
    <p>@Html.LabelFor(model => model.ArrivalDay, "Date d'arrivée")@Html.DropDownListFor(model => model.ArrivalDay, new SelectList(FlyingClub.Models.ViewsModels.DropDownLists.Days))@Html.DropDownListFor(model => model.ArrivalMonth, new SelectList(FlyingClub.Models.ViewsModels.DropDownLists.Months))@Html.DropDownListFor(model => model.ArrivalYear, new SelectList(FlyingClub.Models.ViewsModels.DropDownLists.Years))<label style="width : auto; color : rgb(255, 0, 0);">*</label><label style="width : auto;">Heure d'arrivée</label>@Html.DropDownListFor(model => model.ArrivalHour, new SelectList(FlyingClub.Models.ViewsModels.DropDownLists.Hours))<label style="width : auto; color : rgb(255, 0, 0);">*</label></p>
    <p class="break-line"></p>
    <p>@Html.LabelFor(model => model.ArrivalAirfield, "Aéroport d'arrivée")@Html.TextBoxFor(model => model.ArrivalAirfield)<label style="width : auto; color : rgb(255, 0, 0);">*</label>@Html.ValidationMessageFor(model => model.ArrivalAirfield)</p>
    <p class="break-line"></p>
    if (Session["Staff"] != null)
    { 
        <p>@Html.LabelFor(model => model.PilotID, "Pilote")@Html.DropDownListFor(model => model.PilotID, new SelectList(FlyingClub.Models.ViewsModels.DropDownLists.Pilots, "ID", "Lastname"))<label style="width : auto; color : rgb(255, 0, 0);">*</label>@Html.ValidationMessageFor(model => model.PilotID)</p>
        <p class="break-line"></p>
    }
    else
    {
        @Html.HiddenFor(model => model.PilotID)
    }
    <p>@Html.LabelFor(model => model.PlaneID, "Avion")@Html.DropDownList("PlaneID", String.Empty)<label style="width : auto; color : rgb(255, 0, 0);">*</label>@Html.ValidationMessageFor(model => model.PlaneID)</p>
    <p class="break-line"></p>
    <p><label></label><input type="submit" /><input type="submit" value="Ajouter" /><label style="width : auto; color : rgb(255, 0, 0);">*Champ requis</label></p>
    <p class="break-line"></p>
}

<div>
    <a href="/Flights#user-flights">Retour à l'index</a>
</div>